package com.atguigu.eduservice.client;

import com.atguigu.commonutils.Result;
import com.atguigu.eduservice.client.impl.VodFileDegradeFeignClient;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component
@FeignClient(name = "service-vod", fallback = VodFileDegradeFeignClient.class)
public interface VodClient {
    // 定义调用方法的路径
    // @PathVariable注解一定要指定参数名称，否则出错
    // 根据视频Id删除视频
    @DeleteMapping("/edu/vod/video/removeAliYunVideo/{videoId}")
    Result removeAliYunVideo(@PathVariable("videoId") String videoId);

    @DeleteMapping("/edu/vod/video/removeBatch")
    Result removeBatchAliYunVideos(@RequestParam("videoIdList") List<String> videoIdList);
}
